<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>报审材料详情</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Expires" CONTENT="0">
    <meta http-equiv="Cache-Control" content="no-siteapp,no-transform,no-store, no-cache, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <link rel="shortcut icon" href="../../../favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="../../../static/css/font.css">
    <link rel="stylesheet" href="../../../static/css/weadmin.css">
    <script type="text/javascript" src="/lib/layui/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="../../../static/css/buildUnit/common.css">
</head>
<body>
<div class="content" id="view" style="padding-top:0">
</div>
<script id="templateId" type="text/html">
    <div style="padding-top:15px;">
        受理编号：{{d[0].applyCode || '-'}}
    </div>
    <table class="layui-table">
        <colgroup>
            <col>
            <col>
            <col>
            <col>
            <col>
            <col>
        </colgroup>
        <thead>
        <tr>
            <th>
                受理方
            </th>
            <th>
                审查机构
            </th>
            <th>
                受理人
            </th>
            <th>
                状态
            </th>
            <th>
                受理意见
            </th>
        </tr>
        </thead>
        <tbody>
        {{# layui.each(d,function(index,item){
        }}
        <tr>
            <td>{{item.acceptTypeName}}</td>
            <td>{{item.orgName}}</td>
            <td>{{item.applyMan}}</span></td>
            <td>{{item.acceptStatus}}<br><span>时间：{{item.adviseTime}}</span></td>
            <td>{{item.acceptAdvise}}</td>
        </tr>
        {{# });}}
        </tbody>
    </table>
</script>
<script src="../../../static/js/main.js"></script>
<script type="text/javascript">
    layui.use(['jquery', 'bluebird', 'configure', 'configureCom', 'permission', 'templates', 'templateInit'], function () {
        var element = layui.element;
        var $ = layui.$;
        var table = layui.table;
        var configure = layui.configure;
        var configureCom = layui.configureCom;
        var templates = layui.templates;
        var templateInit = layui.templateInit;
        var templateHtml = $('#templateId').html();
        var reportMateriaDetail = {
            param: {
                searchData: {},
                data: []
            },
            render: function () {
                templates.param.searchData.singleProjectId = configureCom.GetQueryString('singleProjectId');
                templates.getMateriaDetail().then(function (res) {
                    var jointTrial = null;//联审对象
                    var housingConstruction = null;//住建对象
                    $(res.result).each(function (index, item) {
                        if (item.acceptType === configure.AUDIT_ORGAN_TYPE.JOINT_TRIAL.value) {
                            jointTrial = item;
                        }
                        if (item.acceptType === configure.AUDIT_ORGAN_TYPE.HOUSING_CONSTRUCTION.value) {
                            housingConstruction = item;
                        }
                        //审查方
                        if (!item.acceptTypeName) {
                            item.acceptTypeName = '-';
                        }
                        //审查人
                        if (!item.applyMan) {
                            item.applyMan = '-';
                        } else {
                            item.applyMan = item.applyMan + '</br>' + '<span>联系方式：' + (item.applyManTel || "-") + '</span>';
                        }
                        //受理机构
                        if (!item.orgName) {
                            item.orgName = '-';
                        }
                        //审查时间
                        if (item.adviseTime) {
                            item.adviseTime = configureCom.dateToStrAll(item.adviseTime);
                        }
                        else {
                            item.adviseTime = '-';
                        }
                        //受理意见
                        if (!item.acceptAdvise) {
                            item.acceptAdvise = '-';
                        }
                    });
                    jointTrial.orgName = housingConstruction.orgName;
                    templateInit.init('view', res.result, templateHtml);
                });
            }
        };

        reportMateriaDetail.render();
    });
</script>
</body>
</html>